Тема |
---|
Верстак Робот |
Уровень |
Средний |
Время для завершения |
Авторы |
FreeCAD версия |
Примеры файлов |
Смотрите также |
None |
В этом руководстве рассказывается, как использовать FreeCAD и Верстак Симуляции Робота для моделирования движений 6-осевого серийного робота. Руководство посвящено созданию VRML-файла, используемого в качестве визуализации. Основой VRML-файла является модель FreeCAD. Используемая версия FreeCAD - 0.11.4252ppa1 на Ubuntu 32bit.
Руководство основано на STEP-файле робора Stäubli TX40 (TX40-HB.stp). Вы можете скачать этот файл с сайта Stäubli. Однако, хотя у меня не было времени проверить это, метод должен быть применим и к модели, полностью сделанной в FreeCAD. После открытия файла ты должен получить следующее:
Обрати внимание, что при импорте робот состоит из 8 фигур, расположенных непосредственно в корне дерева документа. Структура экспортируемого VRML-файла может измениться, если используются группы. Элементы расположены в порядке от основания к инструменту. Последний элемент содержит оси вращения всех осей робота. Имя корреляции фигуры - задаётся именем детали (на данный момент (март 2011) FreeCAD не импортирует имена, включённые в STEP-файлы):
FreeCAD имя | STEP имя английский | STEP имя русский |
---|---|---|
TX40_HB | HORIZONTAL BASE CABLE OUTLET | ГОРИЗОНТАЛЬНОЕ ОСНОВАНИЕ КАБЕЛЬНЫЙ ВЫВОД |
TX40_HB001 | SHOULDER | ПЛЕЧО |
TX40_HB002 | ARM | РУКА |
TX40_HB003 | ELBOW | ЛОКОТЬ |
TX40_HB004 | FOREARM | ПРЕДПЛЕЧЬЕ |
TX40_HB005 | WRIST | ЗАПЯСТЬЕ |
TX40_HB006 | TOOL FLANGE | ФЛАНЕЦ ИНСТРУМЕНТА |
TX40_HB007 | ? | ? |
Для этого импорта измени "Стиль представления" каждой фигуры, за исключением TX40_HB007, с "Плоские линии" на "Только грани", чтобы экспорт VRML выглядел хорошо. Я также изменил цвета на [245, 196, 0] и [204, 204, 204], чтобы они лучше соответствовали жёлтому цвету Stäubli. Скройте TX40_HB007, потому что он содержит оси всех сочленений и не может быть отсоединён.
Для того чтобы построить таблицу Денавита-Хартенберга (смотри Робот 6-Осевой) и подготовить vrml-файл, необходимо получить характеристики робота. На данный момент инструмент измерения в FreeCAD не готов, вы можете использовать оси, входящие в TX40_HB007 (координаты указываются слева внизу при наведении на объект мышью) или использовать консоль Python для получения некоторой информации о геометрии. Обратите внимание, что DH-таблица нужна только в том случае, если вам нужно использовать обратную кинематику, то есть получить декартовы координаты или управлять роботом с помощью декартовых координат. DH-таблица для этого робота выглядит следующим образом (мм, град и град/с):
i | d | θ | r | α | θмин | θмакс | Скорость вращения оси |
---|---|---|---|---|---|---|---|
1 | 320 | q1 | 0 | -90 | -180 | 180 | 555 |
2 | 35 | q2 - 90 | 225 | 0 | -125 | 125 | 475 |
3 | 0 | q3 + 90 | 0 | 90 | -138 | 138 | 585 |
4 | 225 | q4 | 0 | -90 | -270 | 270 | 1035 |
5 | 0 | q5 | 0 | 90 | -120 | 133.5 | 1135 |
6 | 65 | q6 | 0 | 0 | -270 | 270 | 1575 |
Затем создаётся csv файл:
a , alpha, d , theta, rotDir, maxAngle, minAngle, AxisVelocity 0 , -90, 320, 0, 1, 180, -180, 555 225, 0, 35, -90, 1, 125, -125, 475 0 , 90, 0, 90, 1, 138, -138, 585 0 , -90, 225, 0, 1, 270, -270, 1035 0 , 90, 0, 0, 1, 133.5, -120, 1135 0 , 0, 65, 0, 1, 270, -270, 1575
Экспортируй документ в VRML-файл. Структура VRML-файла выглядит следующим образом:
#VRML V2.0 utf8
Group {
children
Group {
children [
Group {
…
},
Group {
…
},
Group {
…
},
Group {
…
},
Group {
…
},
Group {
…
},
Group {
…
},
Group {
…
} ]
}
}
Вы можете заметить, что у нас есть 8 независимых групп, соответствующих 8 элементам.
Все элементы в VRML-файле выражены в базовом кадре, независимо друг от друга. Для Верстака Симуляции Робота нам нужно создать структуру, в которой движение одного элемента вызывает движение всех последующих элементов структуры. Расположение элементов будет относительным по отношению к предыдущему элементу, поэтому нам необходимо включить некоторые преобразования из абсолютной системы отсчета в относительную. Эти переводы описаны на следующем рисунке:
Здесь
Рассмотрим пример оси 4 между ЛОКТЕМ и ПРЕДПЛЕЧЬЕМ, расположенной в точке D=(xd, yd, zd). Привязкой для оси FreeCAD является
"DEF FREECAD_AXIS4 Transform { rotation 0 1 0 0 children ["
This corresponds to a rotation about the y-axis. In the CAD model, the rotation is about the z-axis. Thus, we need to a rotation about the x-axis of before the FreeCAD axis definition and of after it. Also, a translation of (-xd, -yd, -zd) is needed just before the Group corresponding to the definition of FOREARM to express it in the relative reference frame centered at D. This means that a translation of (xd, yd, zd) must be inserted before the first rotation.
At the end, the VRML file from the definition of ELBOW to the definition of FOREARM looks like this:
# ELBOW
Group {
… here comes the unmodified definition of ELBOW
},
Transform {
translation 0 35 601
rotation 1 0 0 1.5707963
children
DEF FREECAD_AXIS4 Transform { rotation 0 1 0 0 children
Transform {
rotation 1 0 0 -1.5707963
children
Transform {
translation 0 -35 -601
children [
# FOREARM
Group {
... here comes the unmodified definition of FOREARM
},
At the end of the document, the appropriate closing brackets must be inserted: ]}}}},
for each of the 6 axes. Eventually, the document looks like this (I don't know if I can link the file here because of copyrights):
#VRML V2.0 utf8
Group {
children
Group {
children [
# HORIZONTAL BASE CABLE OUTLET
Group {
... here comes the unmodified definition of HORIZONTAL BASE CABLE OUTLET
},
Transform {
translation 0 0 168
rotation 1 0 0 1.5707963
children
DEF FREECAD_AXIS1 Transform { rotation 0 1 0 0 children
Transform {
rotation 1 0 0 -1.5707963
children
Transform {
translation 0 0 -168
children [
# SHOULDER
Group {
... here comes the unmodified definition of SHOULDER
},
Transform {
translation 0 107.8 320
#rotation 0 0 1 0
children
DEF FREECAD_AXIS2 Transform { rotation 0 1 0 0 children
Transform {
#rotation 0 0 1 0
children
Transform {
translation 0 -107.8 -320
children [
# ARM
Group {
... here comes the unmodified definition of ARM
},
Transform {
translation 0 104.15 545
#rotation 0 0 1 0
children
DEF FREECAD_AXIS3 Transform { rotation 0 1 0 0 children
Transform {
#rotation 0 0 1 0
children
Transform {
translation 0 -104.15 -545
children [
# ELBOW
Group {
... here comes the unmodified definition of ELBOW
},
Transform {
translation 0 35 601
rotation 1 0 0 1.5707963
children
DEF FREECAD_AXIS4 Transform { rotation 0 1 0 0 children
Transform {
rotation 1 0 0 -1.5707963
children
Transform {
translation 0 -35 -601
children [
# FOREARM
Group {
... here comes the unmodified definition of FOREARM
},
Transform {
translation 0 35 770
#rotation 0 0 1 0
children
DEF FREECAD_AXIS5 Transform { rotation 0 1 0 0 children
Transform {
#rotation 0 0 1 0
children
Transform {
translation 0 -35 -770
children [
# WRIST
Group {
... here comes the unmodified definition of WRIST
},
Transform {
translation 0 35 835
rotation 1 0 0 1.5707963
children
DEF FREECAD_AXIS6 Transform { rotation 0 1 0 0 children
Transform {
rotation 1 0 0 -1.5707963
children
Transform {
translation 0 -35 -835
children [
# TOOL FLANGE
Group {
... here comes the unmodified definition of TOOL FRAME
},
Group {
... here comes the unmodified definition of TX40_HB007
} # "]" was deleted from this line
]}}}},
]}}}},
]}}}},
]}}}},
]}}}},
]}}}},
] # this is the "]" deleted from the line above
}
}
Here is a patch to obtain the VRML file suitable for robot simulation:
7a8
> # HORIZONTAL BASE CABLE OUTLET
95968a95970,95981
> Transform {
> translation 0 0 168
> rotation 1 0 0 1.5707963
> children
> DEF FREECAD_AXIS1 Transform { rotation 0 1 0 0 children
> Transform {
> rotation 1 0 0 -1.5707963
> children
> Transform {
> translation 0 0 -168
> children [
> # SHOULDER
128428a128442,128453
> Transform {
> translation 0 107.8 320
> #rotation 0 0 1 0
> children
> DEF FREECAD_AXIS2 Transform { rotation 0 1 0 0 children
> Transform {
> #rotation 0 0 1 0
> children
> Transform {
> translation 0 -107.8 -320
> children [
> # ARM
206503a206529,206540
> Transform {
> translation 0 104.15 545
> #rotation 0 0 1 0
> children
> DEF FREECAD_AXIS3 Transform { rotation 0 1 0 0 children
> Transform {
> #rotation 0 0 1 0
> children
> Transform {
> translation 0 -104.15 -545
> children [
> # ELBOW
267111a267149,267160
> Transform {
> translation 0 35 601
> rotation 1 0 0 1.5707963
> children
> DEF FREECAD_AXIS4 Transform { rotation 0 1 0 0 children
> Transform {
> rotation 1 0 0 -1.5707963
> children
> Transform {
> translation 0 -35 -601
> children [
> # FOREARM
417854a417904,417915
> Transform {
> translation 0 35 770
> #rotation 0 0 1 0
> children
> DEF FREECAD_AXIS5 Transform { rotation 0 1 0 0 children
> Transform {
> #rotation 0 0 1 0
> children
> Transform {
> translation 0 -35 -770
> children [
> # WRIST
422053a422115,422126
> Transform {
> translation 0 35 835
> rotation 1 0 0 1.5707963
> children
> DEF FREECAD_AXIS6 Transform { rotation 0 1 0 0 children
> Transform {
> rotation 1 0 0 -1.5707963
> children
> Transform {
> translation 0 -35 -835
> children [
> # TOOL FLANGE
435627c435700,435707
< } ]
---
> }
> ]}}}},
> ]}}}},
> ]}}}},
> ]}}}},
> ]}}}},
> ]}}}},
> ]